<template>
	<view>
		<u-popup :show="show" @close="close" mode="right">
			<policy @send="send" :list="list" :type="type"></policy>
		</u-popup>
		<view class="policy_box" v-if="display == true">
			<view class="policy_list">
				<text class="policy_title">条件设置</text>
				<view class="info_item">
					<text class="item-title">政策名称：</text>
					<view class="">
						<input type="text" placeholder="输入政策名称" v-model="title">
					</view>
				</view>
				<view class="info_item">
					<text class="item-title">交易类型：</text>
					<view class="">
						<text class="multiple" @click="mask(data.tran_list,0)">{{tran_list_name.toString()}}</text>
					</view>
				</view>
				<view class="info_item">
					<text class="item-title">卡类型：</text>
					<view class="">
						<text class="multiple" @click="mask(data.card_list,1)">{{card_list_name.toString()}}</text>
					</view>
				</view>
				<view class="info_item">
					<text class="item-title">费率：</text>
					<view class="">
						<text class="multiple" @click="mask(data.rate_list,2)">{{rate_list_name.toString()}}</text>
					</view>
				</view>
				<view class="info_item">
					<text class="item-title">收款方式：</text>
					<view class="">
						<text class="multiple"
							@click="mask(data.channel_list,3)">{{channel_list_name.toString()}}</text>
					</view>
				</view>
				<!-- <view class="info_item">
					<text class="item-title">激活判定：</text>
					<view class="">
						
					</view>
				</view>
				<view class="info_item">
					<text class="item-title">押金版：</text>
					<view class="">
						
					</view>
				</view> -->
			</view>
			<view class="policy_list">
				<text class="generate" @click="generate">生成设置</text>
			</view>
			<view v-if="is_show" class="">
				<view class="policy_list" v-if="total_list !== undefined && total_list!== null && total_list.length>0">
					<text class="policy_title">分润设置</text>
					<view class="ha_setup_box">
						<view class="ha_setup">
							<view class="ha_setup_list ha_setup_tit">
								<text class="average">交易类型</text>
								<text class="average">卡类型</text>
								<text class="average">费率</text>
								<text class="average">收款方式</text>
								<text class="average">结算</text>
								<text class="average">隐形</text>
							</view>
							<view class="ha_setup_list" v-for="(item,index) in total_list" :key="index"
								:class="item.base != 0 || item.hide != 0 ? '' : 'height_0'">
								<text class="average">{{item.tran.name}}</text>
								<text class="average">{{item.card.name}}</text>
								<text class="average">{{item.rate.name}}</text>
								<text class="average">{{item.channel.name}}</text>
								<input class="average" type="number" placeholder="0"
									v-model="new_profit_list[index].base" v-if="item.base == 0" disabled>
								<input class="average" type="number" :placeholder=" '0'+ '~' +item.base"
									v-model="new_profit_list[index].base" v-else>
								<input class="average" type="number" placeholder="0"
									v-model="new_profit_list[index].hide" v-if="item.hide == 0" disabled>
								<input class="average" type="number" :placeholder=" '0'+ '~' +item.hide"
									v-model="new_profit_list[index].hide" v-else>
							</view>
						</view>
					</view>
				</view>
				<view v-if="data.cash && data.cash.base > 0" class="policy_list">
					<text class="policy_title">激活返现设置</text>
					<view class="info_item">
						<text class="item-title">天数限制：</text>
						<view class="">
							<input type="number" :value="data.cash.day_limit" disabled>
						</view>
					</view>
					<view class="info_item">
						<text class="item-title">刷卡金额：</text>
						<view class="">
							<input type="number" :value="data.cash.money" disabled>
						</view>
					</view>
					<view class="info_item" v-show="data.cash.base != 0">
						<text class="item-title">奖励金额：</text>
						<view class="">
							<input type="number" :placeholder="'请输入0-' + data.cash.base" v-model="cash_base"
								@input="restrain(data.cash.base,cash_base)">
						</view>
					</view>
					<view class="info_item" v-show="data.cash.hide != 0">
						<text class="item-title">隐形金额：</text>
						<view class="">
							<input type="number" :placeholder="'请输入0-' + data.cash.hide" v-model="cash_hide"
								@input="restrain(data.cash.hide,cash_hide)">
						</view>
					</view>
				</view>
				<view v-if="data.deposit && data.deposit.reward && data.deposit.reward > 0" class="policy_list">
					<text class="policy_title">押金设置</text>
					<view class="info_item" v-show="data.deposit.reward != 0">
						<text class="item-title">金额：</text>
						<view class="">
							<input type="number" :placeholder="'请输入0-' + data.deposit.reward" v-model="deposit_reward"
								@input="restrain(data.deposit.reward,deposit_reward)">
						</view>
					</view>
				</view>
				<view v-if="data.deposit_standard && data.deposit_standard.length>0 && data.policy.deposit_reward > 0" class="policy_list">
					<text class="policy_title">押金考核设置</text>
					<view v-if="data.deposit_standard.length>0" class="deposit_standard">
						<view class="items">
							<view class="left">
								时间段(天)
							</view>
							<view class="right">
								刷卡金额
							</view>
						</view>
						<view v-for="(item,index) in data.deposit_standard" :key="index" class="item">
							<view class="left">
								{{item.day_start}} ~ {{item.day_end}}
							</view>
							<view class="right">
								{{item.require}}
							</view>
						</view>
					</view>
					<view class="info_item" v-show="data.policy.reward != 0">
						<text class="item-title">金额：</text>
						<view class="">
							<input type="number" :placeholder="'请输入0-' + data.policy.deposit_reward" v-model="deposit_rewardB"
								@input="restrain(data.policy.deposit_reward,deposit_rewardB)">
						</view>
					</view>
				</view>
				<view v-if="data.flow && data.flow.base > 0" class="policy_list">
					<text class="policy_title">流量卡设置</text>
					<view class="info_item" v-show="data.flow.base > 0">
						<text class="item-title">奖励金额：</text>
						<view class="">
							<input type="number" :placeholder="'请输入0-' + data.flow.base" v-model="flow_base"
								@input="restrain(data.flow.base,flow_base)">
						</view>
					</view>
					<view class="info_item" v-show="data.flow.hide != 0">
						<text class="item-title">隐形金额：</text>
						<view class="">
							<input type="number" :placeholder="'请输入0-' + data.flow.hide" v-model="flow_hide"
								@input="restrain(data.flow.hide,flow_hide)">
						</view>
					</view>
				</view>
				<view class="policy_list" v-if="standard.length > 0">
					<text class="policy_title">达标奖励设置</text>
					<view class="" style="border-bottom: 1px solid #eee;padding-bottom: 20rpx;"
						v-for="(item,index) in standard" :key="index">
						<view class="info_item">
							<text class="item-title">交易天数：</text>
							<view class="">
								<input type="number" :value="item.day_limit" disabled>
							</view>
						</view>
						<view class="info_item">
							<text class="item-title">刷卡金额：</text>
							<view class="">
								<input type="number" :value="item.money" disabled>
							</view>
						</view>
						<view class="info_item" v-show="item.base > 0">
							<text class="item-title">奖励金额：</text>
							<view class="">
								<input type="number" :placeholder="'请输入0-' + item.base" v-model="item.base_value"
									@input="restrain(item.base,item.base_value)">
							</view>
						</view>
					</view>
				</view>
				<!-- 保存 -->
				<view class="confirm" @click="handle">保存设置</view>
			</view>
		</view>
	</view>
</template>

<script>
	import policy from '@/component/add_policy.vue'
	export default {
		data() {
			return {
				is_show: false,
				display: false,
				show: false,
				policys: {},
				data: {},
				list: [],
				tran_list_name: '请选择', //交易类型
				tran_list_id: [],
				card_list_name: '请选择', //卡类型
				card_list_id: [],
				rate_list_name: '请选择', //费率
				rate_list_id: [],
				channel_list_name: '请选择', //收款方式
				channel_list_id: [],
				type: null,
				profit_list: [],
				profit_id: [],
				result_excess: [],
				result: [],
				product_id: null,
				title: '', //政策名称
				cash_limit: '', //返现天数限制
				cash_money: '', //刷卡金额
				cash_base: '', //基础金额
				cash_hide: '', //隐形金额
				flow_base: '', //流量卡基础
				flow_hide: '', //隐形
				standard: [], //达标
				deposit_reward: '', //押金
				deposit_rewardB: '', //押金
				profit: [],
				tran_list: [],
				card_list: [],
				rate_list: [],
				channel_list: [],
				total_list: [],
				old_profit_list: [],
				new_profit_list: []
			}
		},
		components: {
			policy
		},
		onLoad(e) {
			this.product_id = e.id
			this._request()
		},
		methods: {
			restrain(primary, now) {
				if (parseInt(now) > parseInt(primary)) {
					uni.showToast({
						title: '输入超出限制',
						icon: 'none',
						duration: 3000,
						success() {
							now = ''
						}
					})
				}
			},
			async _request() {
				uni.showLoading({
					title: '加载中'
				});
				const {
					data: res
				} = await this.$myHttp({
					url: 'setting/getPolicySetting',
					data: {
						product_id: this.product_id
					}
				});
				uni.hideLoading();
				if (res.code == 200) {
					// this.cash_limit = res.data.cash.day_limit //返现天数限制
					// this.cash_money = res.data.cash.money //刷卡金额
					// this.standard = res.data.standard //达标天数限制
					// this.standard.forEach((item, index) => {
					// 	item.base_value = ''
					// 	item.hide_value = ''
					// });
					this.data = res.data
					this.display = true
				} else {
					uni.showToast({
						title: res.msg,
						icon: 'none',
						duration: 3000
					})
				}
			},
			//右侧展开
			close() {
				this.show = false
				let uniPlatform = uni.getSystemInfoSync().uniPlatform;
				if (uniPlatform == 'web') {
					var mo = function(e) {
						e.preventDefault();
					};
					document.body.style.overflow = ''; //出现滚动条
					document.removeEventListener("touchmove", mo, false);
				}
			},
			mask(list, type) {
				this.show = true
				this.list = list
				this.type = type
				let uniPlatform = uni.getSystemInfoSync().uniPlatform;
				// H5禁止滚动
				if (uniPlatform == 'web') {
					var mo = function(e) {
						e.preventDefault();
					};
					document.body.style.overflow = 'hidden';
					document.addEventListener("touchmove", mo, false); //禁止页面滑动
				}
			},
			//子组件传值
			send(id, name, type, Arr) {
				// console.log(Arr)
				switch (type) {
					case 0:
						this.tran_list = Arr
						this.tran_list_name = []
						this.tran_list_id = []
						// this.result_excess[type] = Arr
						this.tran_list_name = name
						this.tran_list_id = id

						break
					case 1:
						this.card_list = Arr
						this.card_list_name = []
						this.card_list_id = []
						// this.result_excess[type] = Arr
						this.card_list_name = name
						this.card_list_id = id
						break
					case 2:
						this.rate_list = Arr
						this.rate_list_name = []
						this.rate_list_id = []
						// this.result_excess[type] = Arr
						this.rate_list_name = name
						this.rate_list_id = id
						break
					case 3:
						this.channel_list = Arr
						this.channel_list_name = []
						this.channel_list_id = []
						// this.result_excess[type] = Arr
						this.channel_list_name = name
						this.channel_list_id = id
						break
				}
				this.show = false
				let uniPlatform = uni.getSystemInfoSync().uniPlatform;
				if (uniPlatform == 'web') {
					var mo = function(e) {
						e.preventDefault();
					};
					document.body.style.overflow = ''; //出现滚动条
					document.removeEventListener("touchmove", mo, false);
				}
			},
			//生成设置
			async generate() {
				this.is_show = false
				uni.showLoading({
					title: '加载中'
				});
				this.result = []
				let _this = this
				this.total_list = []
				if (this.channel_list_id.length > 0 && this.rate_list_id.length > 0 && this.card_list_id.length > 0 &&
					this
					.tran_list_id.length > 0) {
					_this.tran_list.forEach((item1, index1) => {
						_this.card_list.forEach((item2, index2) => {
							_this.rate_list.forEach((item3, index3) => {
								_this.channel_list.forEach((item4, index4) => {
									let obj = {
										tran: item1,
										card: item2,
										rate: item3,
										channel: item4,
										base: 0,
										hide: 0,
										max: 0
									}
									_this.total_list.push(obj)
								})
							})
						})
					})
					this.total_list.forEach((item, index) => {
						_this.checkSetting(item, index)
					});
					setTimeout(function() {
						uni.hideLoading();
						_this.is_show = true
					}, 1500)
				} else {
					uni.showToast({
						title: '政策设置不能为空',
						icon: 'none',
						duration: 3000
					})
				}
			},
			//检测分润设置
			async checkSetting(item, index) {
				const userinfo = uni.getStorageSync('userinfo');
				const {
					data: res
				} = await this.$myHttp({
					url: 'setting/checkSetting',
					data: {
						policy_id: this.data.policy_id,
						tran_id: item.tran.id,
						card_id: item.card.id,
						rate_id: item.rate.id,
						channel_id: item.channel.id
					},
					header: {
						'token': userinfo.token
					},
				});
				if (res.code == 1) {
					this.old_profit_list.push(res.data)
					let obj = {
						base: '',
						hide: ''
					}
					this.new_profit_list.push(obj)
					this.total_list[index].base = res.data.base
					this.total_list[index].hide = res.data.hide
					this.total_list[index].max = res.data.max
				} else {
					uni.showToast({
						title: res.msg,
						icon: 'none',
						duration: 3000
					})
					return false
				}
			},
			handle() {
				let _this = this
				let ret = true
				if (this.title == '') {
					uni.showToast({
						title: '政策名称不能为空',
						icon: 'none',
						duration: 3000,
					})
					return false
				}
				// 分润验证
				try {
					this.total_list.forEach((item, index) => {
						if (item.base == 0 && item.hide == 0) {
							_this.new_profit_list[index].base = 0
							_this.new_profit_list[index].hide = 0
						} else {
							if (item.base > 0) {
								if (_this.new_profit_list[index].base == '') {
									uni.showToast({
										title: '结算不能为空',
										icon: 'none',
										duration: 1500,
									});
									throw new Error("ending")
								} else {
									if (parseFloat(_this.new_profit_list[index].base) > parseFloat(item.base)) {
										uni.showToast({
											title: '结算超出限制',
											icon: 'none',
											duration: 1500,
										});
										throw new Error("ending")
									}
								}
							}
							if (item.hide > 0) {
								if (_this.new_profit_list[index].hide == '') {
									uni.showToast({
										title: '分润隐形不能为空',
										icon: 'none',
										duration: 1500,
									});
									throw new Error("ending")
								} else {
									if (parseFloat(_this.new_profit_list[index].hide) > parseFloat(item.hide)) {
										uni.showToast({
											title: '分润隐形超出限制',
											icon: 'none',
											duration: 1500,
										});
										throw new Error("ending")
									}
								}
							}
						}
					})
				} catch (e) {
					if (e.message == "ending") {
						return false
					}
				}
				// 返现验证
				if (parseFloat(_this.data.cash.base) == 0) {
					_this.cash_base = 0
				} else {
					if (this.data.cash.base != 0 && _this.cash_base === '') {
						uni.showToast({
							title: '返现奖励不能为空',
							icon: 'none',
							duration: 3000,
						})
						return false
					} else {
						if (parseFloat(_this.data.cash.base) < parseFloat(_this.cash_base)) {
							uni.showToast({
								title: '返现奖励超出限制',
								icon: 'none',
								duration: 3000,
							})
							return false
						}
					}
				}
				if (parseFloat(_this.data.cash.hide) == 0) {
					_this.cash_hide = 0
				} else {
					if (_this.cash_hide === '') {
						uni.showToast({
							title: '返现隐形不能为空',
							icon: 'none',
							duration: 3000,
						})
						return false
					} else {
						if (parseFloat(_this.data.cash.hide) < parseFloat(_this.cash_hide)) {
							uni.showToast({
								title: '返现隐形超出限制',
								icon: 'none',
								duration: 3000,
							})
							return false
						}
					}
				}
				// 押金验证
				if (this.data.deposit != null && this.data.deposit.reward) {
					if (this.data.deposit.reward > 0) {
						if (this.deposit_reward == '') {
							uni.showToast({
								title: '押金金额不能为空',
								icon: 'none',
								duration: 3000,
							})
							return false
						}
						if (parseFloat(_this.data.deposit.reward) < parseFloat(_this.deposit_reward) || parseFloat(_this.deposit_reward) < 0) {
							uni.showToast({
								title: '押金金额超出限制',
								icon: 'none',
								duration: 3000,
							})
							return false
						}
					}
				}
				// 押金考核验证
				if (this.data.policy.deposit_reward != null && this.data.deposit_standard.length > 0 && this.data.policy.deposit_reward > 0) {
					if (this.deposit_rewardB == '') {
						uni.showToast({
							title: '押金考核金额不能为空',
							icon: 'none',
							duration: 3000,
						})
						return false
					}
					if (parseFloat(_this.data.policy.deposit_reward) < parseFloat(_this.deposit_rewardB) || parseFloat(_this.deposit_rewardB) < 0) {
						uni.showToast({
							title: '押金考核金额超出限制',
							icon: 'none',
							duration: 3000,
						})
						return false
					}
				}
				// 流量卡验证
				if (parseFloat(_this.data.flow.base) == 0) {
					_this.flow_base = 0
				} else {
					if (_this.flow_base === '') {
						uni.showToast({
							title: '流量卡奖励不能为空',
							icon: 'none',
							duration: 3000,
						})
						return false
					} else {
						if (parseFloat(_this.data.flow.base) < parseFloat(_this.flow_base)) {
							uni.showToast({
								title: '流量卡奖励超出限制',
								icon: 'none',
								duration: 3000,
							})
							return false
						}
					}
				}
				if (parseFloat(_this.data.flow.hide) == 0) {
					_this.flow_hide = 0
				} else {
					if (_this.flow_hide === '') {
						uni.showToast({
							title: '流量卡隐形不能为空',
							icon: 'none',
							duration: 3000,
						})
						return false
					} else {
						if (parseFloat(_this.data.flow.hide) < parseFloat(_this.flow_hide)) {
							uni.showToast({
								title: '流量卡隐形超出限制',
								icon: 'none',
								duration: 3000,
							})
							return false
						}
					}
				}
				// 达标验证
				try {
					this.standard.forEach((item, index) => {
						if (item.base == 0) {
							item.base_value = 0
						} else if (item.base_value == '') {
							item.base_value = 0
						} else {
							if (item.base > 0) {
								if (parseFloat(item.base_value) > parseFloat(item.base)) {
									uni.showToast({
										title: '达标奖励超出限制',
										icon: 'none',
										duration: 1500,
									});
									throw new Error("ending")
								}
							}
						}
					})
				} catch (e) {
					if (e.message == "ending") {
						return false
					}
				}
				let tran = []
				this.total_list.map((item, index) => {
					tran[index] = item.tran.id
				})
				let card = []
				this.total_list.map((item, index) => {
					card[index] = item.card.id
				})
				let rate = []
				this.total_list.map((item, index) => {
					rate[index] = item.rate.id
				})
				let channel = []
				this.total_list.map((item, index) => {
					channel[index] = item.channel.id
				})
				let profit_base = []
				this.new_profit_list.map((item, index) => {
					profit_base[index] = item.base == '' ? 0 : item.base
				})
				let profit_hide = []
				this.new_profit_list.map((item, index) => {
					profit_hide[index] = item.hide == '' ? 0 : item.hide
				})
				let standard_limit = [] //天数
				this.standard.map((item, index) => {
					standard_limit[index] = item.day_limit
				})
				let standard_money = [] //刷卡金额
				this.standard.map((item, index) => {
					standard_money[index] = item.money
				})
				let standard_base = [] //基础
				this.standard.map((item, index) => {
					standard_base[index] = item.base_value
				})
				let standard_hide = []
				this.standard.map((item, index) => {
					standard_hide[index] = item.hide_value
				})
				let day_start = []
				let day_end = []
				let require = []
				this.data.deposit_standard.map((item, index) => {
					day_start[index] = item.day_start
					day_end[index] = item.day_end
					require[index] = item.require
				})

				this.confirm(tran, card, rate, channel, profit_base, profit_hide, standard_limit, standard_money,
					standard_base, standard_hide, day_start, day_end, require)
			},
			async confirm(tran, card, rate, channel, profit_base, profit_hide, standard_limit, standard_money,
				standard_base, standard_hide, day_start, day_end, require) {
				const userinfo = uni.getStorageSync('userinfo');
				const {
					data: res
				} = await this.$myHttp({
					url: 'setting/savePolicySetting',
					data: {
						title: this.title, //政策标题
						top_policy_id: this.data.policy_id, //政策ID
						product_id: this.product_id, //产品ID
						card_type: this.card_list_id.toString(),
						transaction_type_ids: this.tran_list_id.toString(),
						rate_ids: this.rate_list_id.toString(),
						channel_ids: this.channel_list_id.toString(),
						card: card,
						tran: tran,
						rate: rate,
						channel: channel,
						profit_base: profit_base, //分润基础
						profit_hide: profit_hide, //分润隐形
						cash_limit: this.cash_limit, //返现天数限制
						cash_money: this.cash_money, //刷卡金额
						cash_base: this.cash_base === '' ? 0 : this.cash_base, //基础金额
						cash_hide: this.cash_hide, //隐形金额
						flow_base: this.flow_base, //流量卡基础
						flow_hide: this.flow_hide, //隐形
						standard_limit: standard_limit, //达标天数限制
						standard_money: standard_money, //刷卡金额
						standard_base: standard_base, //基础
						standard_hide: standard_hide, //隐形
						deposit: this.deposit_reward === '' ? 0 : this.deposit_reward, //押金
						active_type: this.data.policy.active_type, //激活
						deposit_type: this.data.policy.deposit_type,//是否押金
						deposit_reward: this.deposit_rewardB === '' ? 0 : this.deposit_rewardB,
						day_start: day_start,
						day_end: day_end,
						require: require
						
					},
					header: {
						'token': userinfo.token
					},
				});
				if (res.code == 1) {
					uni.showToast({
						title: res.msg,
						icon: 'none',
						duration: 2000,
						success() {
							setTimeout(() => {
								uni.navigateBack({});
							}, 1500)
						}
					})
				} else {
					uni.showToast({
						title: res.msg,
						icon: 'none',
						duration: 3000
					})
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.info_item {
		margin-top: 15rpx;
		font-size: 28rpx;
		display: flex;
		justify-content: space-between;

		view {
			width: 50%;
			// text-align: right;
			display: flex;
			justify-content: flex-end;
			flex-wrap: wrap;

			.multiple {
				border: #eee 1px solid;
				padding: 10rpx;
				box-sizing: border-box;
				width: 100%;
				border-radius: 5rpx;
				text-align: center;
			}
		}

		.item-title {
			line-height: 60rpx;
		}
	}

	.confirm {
		padding: 20rpx;
		box-sizing: border-box;
		width: 100%;
		margin: 50rpx auto 0 auto;
		border-radius: 10rpx;
		background-color: #1688f1;
		color: #fff;
		text-align: center;
	}

	.policy_box {
		padding: 30rpx;
		box-sizing: border-box;

		.policy_list {
			padding: 20rpx;
			border-radius: 15rpx;
			box-shadow: 0px 1px 14px -10px #999;
			margin-bottom: 30rpx;


			.generate {
				display: flex;
				justify-content: center;
				background-color: #1296db;
				color: #ffffff;
				padding: 10px 0px;
				border-radius: 5px;
			}

			.policy_standard {
				margin-bottom: 30rpx;
			}

			.policy_standard:not(:first-child) {
				margin-top: 20rpx;
				padding-top: 20rpx;
				border-top: #bcbcbc 1px solid;
			}

			.policy_title {
				border-bottom: #ebebeb dotted 1px;
				width: 100%;
				display: block;
				padding: 0 0 20rpx 0;
				margin-bottom: 20rpx;
				font-size: 28rpx;
				color: #333;
			}

			.policy_item {
				display: flex;
				align-items: center;
				justify-content: space-between;
				margin-bottom: 10rpx;

				text {
					font-size: 24rpx;
					color: #999;
				}
			}
			
			.deposit_standard {
				padding: 0 20rpx 10rpx 0;
				font-size: 24rpx;
				border-bottom: 1px dotted #ebebeb;
				.items {
					padding-bottom: 20rpx;
					display: flex;
					justify-content: space-between;
				}
				.item {
					padding: 10rpx 0;
					border-top: 1px dotted #ebebeb;
					display: flex;
					justify-content: space-between;
				}
			}
		}
	}

	input {
		padding: 5px 0;
		border: 1px solid #eee;
		font-size: 13px;
		text-align: center;
		border-radius: 5rpx;
		width: 100%;
	}

	.ha_setup_box {

		.ha_setup {
			.ha_setup_list {
				margin-bottom: 20rpx;
				display: flex;
				align-items: center;
				justify-content: space-between;

				.average {
					display: block;
					text-align: center;
					font-size: 24rpx;
					flex: 1;
				}
			}

			.height_0 {
				height: 0 !important;
				overflow: hidden;
				margin: 0 !important;
			}

			.ha_setup_tit {
				border-bottom: #eee 1px solid;
				padding-bottom: 20rpx;
			}
		}
	}
</style>